package com.slkj.shilixiaoyuanapp.ui.ZhongHeXiaoXue;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.SimpleItemAnimator;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.slkj.shilixiaoyuanapp.R;
import com.slkj.shilixiaoyuanapp.base.ActivityInfo;
import com.slkj.shilixiaoyuanapp.base.BaseActivity;
import com.slkj.shilixiaoyuanapp.entity.GradeEntity;
import com.slkj.shilixiaoyuanapp.entity.parent.ExerciseHistoryEntity;
import com.slkj.shilixiaoyuanapp.ui.ZhongHeXiaoXue.adapter.GradeMonthAdapter;
import com.slkj.shilixiaoyuanapp.ui.ZhongHeXiaoXue.adapter.ReadGradeAdapter;
import com.slkj.shilixiaoyuanapp.ui.teacher.tool.DisciplineInspection.GradeAdapter;
import com.slkj.shilixiaoyuanapp.view.DividerItemDecoration;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

@ActivityInfo(layout = R.layout.activity_read,isShowActionBar = false)
public class ReadActivity extends BaseActivity {
    @BindView(R.id.recycer_readtype)
    RecyclerView recycer_readtype;
    @BindView(R.id.recycer_readgrade)
    RecyclerView recycer_readgrade;
    @BindView(R.id.rv_content)
    RecyclerView rv_content;
    ReadGradeAdapter gradeAdapter;
    GradeMonthAdapter monthAdapter;
    BaseQuickAdapter adapter;
    List<GradeEntity> data = new ArrayList<>();
    List<String> datas=new ArrayList<>();
    @Override
    protected void init() {
        datas.add("1");
        datas.add("1");
        datas.add("1");
        datas.add("1");
        datas.add("1");
        datas.add("1");
        ((SimpleItemAnimator)recycer_readtype.getItemAnimator()).setSupportsChangeAnimations(false);
        gradeAdapter = new ReadGradeAdapter(this,data);
        recycer_readtype.setLayoutManager(new LinearLayoutManager(this));
        recycer_readtype.addItemDecoration(new DividerItemDecoration(this,LinearLayoutManager.HORIZONTAL));
        recycer_readtype.setAdapter(gradeAdapter);

        ((SimpleItemAnimator)recycer_readgrade.getItemAnimator()).setSupportsChangeAnimations(false);
        monthAdapter = new GradeMonthAdapter(this,data);
        recycer_readgrade.setLayoutManager(new LinearLayoutManager(this));
        recycer_readgrade.addItemDecoration(new DividerItemDecoration(this,LinearLayoutManager.HORIZONTAL));
        recycer_readgrade.setAdapter(monthAdapter);

        rv_content.setLayoutManager(new LinearLayoutManager(this));
        adapter = new BaseQuickAdapter<String, BaseViewHolder>(R.layout.item_read_content, datas) {
            @Override
            protected void convert(BaseViewHolder helper, final String item) {
                helper.setText(R.id.tv_student_name,"王一明")
                        .setText(R.id.tv_readtime,"160").setText(R.id.tv_level,"A").setText(R.id.tv_comments,"评语");
            }

        };
    }
}
